
`timescale 1ns / 1ns
module CcdCaptureTest   ; 

  wire  [9:0]  oYCount   ; 
  reg    iPclk   ; 
  reg    iHref   ; 
  reg    iFodd   ; 
  reg    iCaptureEn   ; 
  wire    oRst   ; 
  wire    oPwDn   ; 
  wire  [9:0]  oXCount   ; 
  wire    oBusy   ; 
  wire  [7:0]  oWrData   ; 
  wire    oWrClk   ; 
  reg  [7:0]  iDataYG   ; 
  reg    iVsync   ; 
  wire  [18:0]  oWrAddress   ; 
  CcdCapture  #(.FIRST_FRAME_VALID(1)) DUT  ( 
      .oYCount (oYCount ) ,
      .iPclk (iPclk ) ,
      .iHref (iHref ) ,
      .iFodd (iFodd ) ,
      .iCaptureEn (iCaptureEn ) ,
      .oRst (oRst ) ,
      .oPwDn (oPwDn ) ,
      .oXCount (oXCount ) ,
      .oBusy (oBusy ) ,
      .oWrData (oWrData ) ,
      .oWrClk (oWrClk ) ,
      .iDataYG (iDataYG ) ,
      .iVsync (iVsync ) ,
      .oWrAddress (oWrAddress ) ); 



// "Clock Pattern" : dutyCycle = 1
// Start Time = 0 ns, End Time = 50 ms, Period = 33333333 ns
  initial
  begin
	  iVsync  = 1'b0  ;
	 # 74 ;
	  iVsync  = 1'b1  ;
	 # 333259 ;
	  iVsync  = 1'b0  ;
	 # 33000000 ;
	  iVsync  = 1'b1  ;
	 # 333333	  iVsync  = 1'b0  ;
	 # 16333334 ;
// dumped values till 50 ms
  end


// "Constant Pattern"
// Start Time = 0 ns, End Time = 50 ms, Period = 0 ns
  initial
  begin
	  iHref  = 1'b1  ;
	 # 50000000 ;
// dumped values till 50 ms
  end


// "Clock Pattern" : dutyCycle = 50
// Start Time = 0 ns, End Time = 50 ms, Period = 74 ns
  initial
  begin
	iPclk  = 1'b0  ;
	repeat(675676) begin
	  # 37 	  iPclk  = 1'b1  ;
	  # 37	  iPclk  = 1'b0  ;
	end	 
  end


// "Random Pattern"(Uniform) : seed = 10
// Start Time = 0 ns, End Time = 50 ms, Period = 74 ns
  initial
  begin
	iDataYG  = 8'b01010101  ;
	repeat(337838) begin	  
	  # 74	  iDataYG  = 8'b10101010  ;
	  # 74	  iDataYG  = 8'b01010101  ;
	end
  end


// "Constant Pattern"
// Start Time = 0 ns, End Time = 50 ms, Period = 0 ns
  initial
  begin
	  iCaptureEn  = 1'b1  ;
	 # 50000000 ;
// dumped values till 50 ms
  end

  initial
	#35000000 $stop;
endmodule
